var inOrder = {
	add : function(flag,id) {
		var html = "";
		if(flag == 0) {
			html = '<iframe name="inOrderSaveFrame" id="inOrderSaveFrame" src="'
				+ projectName
				+ '/stock/inOrder/save.t4m?'
				+ getFlushParam('saveInOrder')
				+ '&arriveOrderId='
				+ id
				+ '" frameborder="0" scrolling="auto"></iframe>';
		}else {
			html = '<iframe name="inOrderSaveFrame" id="inOrderSaveFrame" src="'
			+ projectName
			+ '/stock/inOrder/save.t4m?'
			+ getFlushParam('saveInOrder')
			+ '&salesBackOrderId='
			+ id
			+ '" frameborder="0" scrolling="auto"></iframe>'
		}
		new WindowPanel(
				{
					id : 'saveInOrder',
					title : '生成入库单',
					width : 650,
					height : 400,
					closeConfirm : true,
					maximizable : false,
					html : html,
					tbar : new Toolbar({
						icon : 'image/op.gif',
						items : [ {
							type : 'button',
							text : '保存入库单',
							position : {
								a : '-80px 0px',
								b : '-80px -120px'
							},
							handler : function() {
								submitFrameForm('inOrderSaveFrame',
										'inOrderForm');
							}
						} ]
					})
				});
	},
	edit : function(id) {
		new WindowPanel(
				{
					id : 'updateInOrder',
					title : '修改入库单',
					width : 650,
					height : 400,
					closeConfirm : true,
					maximizable : false,
					html : '<iframe name="inOrderUpdateFrame" id="inOrderUpdateFrame" src="'
							+ projectName
							+ '/stock/inOrder/toUpdate.t4m?'
							+ getFlushParam('updateInOrder')
							+ '&inOrderId='
							+ id
							+ '" frameborder="0" scrolling="auto"></iframe>',
					tbar : new Toolbar({
						icon : 'image/op.gif',
						items : [ {
							type : 'button',
							text : '保存入库单',
							position : {
								a : '-80px 0px',
								b : '-80px -120px'
							},
							handler : function() {
								submitFrameForm('inOrderUpdateFrame',
										'inOrderForm');
							}
						} ]
					})
				});
	},
	view : function(id) {
		new WindowPanel(
				{
					id : 'viewInOrder',
					title : '查看入库单',
					width : 650,
					height : 400,
					closeConfirm : true,
					maximizable : false,
					html : '<iframe name="inOrderViewFrame" id="inOrderViewFrame" src="'
							+ projectName
							+ '/stock/inOrder/toView.t4m?'
							+ getFlushParam('viewInOrder')
							+ '&inOrderId='
							+ id
							+ '" frameborder="0" scrolling="auto"></iframe>'
				});
	}
};